package activity;

/**
 * A {@code License} is a utility class that is used as an attribute of the
 * balloon artifacts.
 */
public final class License {
	private String text;

	/**
	 * Creates a new license based on the specified text.
	 * 
	 * @param text the String form of the license
	 */
	public License(String text) {
		this.text = text;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((text == null) ? 0 : text.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final License other = (License) obj;
		if (text == null) {
			if (other.text != null)
				return false;
		} else if (!text.equals(other.text))
			return false;
		return true;
	}

	/**
	 * Return the text associated with this license
	 * 
	 * @return the license in text form.
	 */
	public String getText() {
		return text;
	}	
}
